#ifndef _SB3D_COMMON_H_
#define _SB3D_COMMON_H_

#include <ctime>

#define MAX_SYSPATH		1024	// system filepath

// filesystem flags
#define FS_STATIC_PATH	1	// FS_ClearSearchPath will be ignore this path
#define FS_NOWRITE_PATH	2	// default behavior - last added gamedir set as writedir. This flag disables it
#define FS_GAMEDIR_PATH	4	// just a marker for gamedir path

#define BIT( n )		(1<<( n ))
#define bound( min, num, max ) ((num) >= (min) ? ((num) < (max) ? (num) : (max)) : (min))

typedef struct
{
	int		filepos;
	int		disksize;
	int		size;		// uncompressed
	char		type;
	char		compression;	// probably not used
	char		pad1;
	char		pad2;
	char		name[16];		// must be null terminated
} dlumpinfo_t;

typedef struct wfile_s
{
	char		filename [MAX_SYSPATH];
	int		infotableofs;
	unsigned char		*mempool;	// W_ReadLump temp buffers
	int		numlumps;
	int		mode;
	int		handle;
	dlumpinfo_t	*lumps;
	time_t		filetime;
};

typedef struct wfile_s	wfile_t;	// wad file

#endif